1. Field of Invention
The present invention relates to interpolation in a video encoding and decoding system. More particularly, the present invention relates to a method for storing interpolation data in a video encoding and decoding system.
2. Description of Related Art
In the current video encoding and decoding system, the motion estimation has precisions of ½, ¼, ⅛ points, wherein these non-integer points do not exist in an external memory and are obtained through the calculation of integer points in the external memory. Therefore, in the video encoding and decoding system, interpolation is adopted no matter for motion estimation or motion compensation, as long as the motion vector of non-integer points is concerned.
For example, referring to FIG. 1, in the H.264 video system specification, the pixel value at the ½ point is calculated by a six-tap finite impulse response (FIR). In FIG. 1, white blocks (such as A, B, C, D) represent the positions of integer points, and lined blocks (such as aa, bb, h, m) represent the positions of ½ points that need interpolation. The pixel value at b point is the integer value of the formula (E−5F+20G+20H−5I+J)/32. The pixel value at h point is the integer value of the formula (A−5C+20G+20M−5R+T)/32. Seen from the above formulae, the pixel value at ½ point is calculated through four multiply operations. As for the recently most popular image format, i.e., the common intermediate format (CIF), each frame has 352×288 pixels, such that (703×575−352×288(integer points))×4=1,211,396 multiply operations, approximately 1.2 million multiply operations, are needed to calculate all pixel values at ½ points of the CIF, and approximately 50 million multiply operations are needed to calculate all pixel values at ⅛ points. In addition, the pixel values at ¼ points can be calculated by an adder and a shifter, and thus are not discussed here. Moreover, in the CIF, the ½ points all-together have 703×575−352×288(integer points)=302,846 pixels, which represents that approximately 296 Kbytes memory space is required for storing all of the pixel values at ½ points, and about 6 Mbytes memory space is required for storing all of the pixel values at ⅛ points. As the interpolation points are deduced from the integer points stored in the external memory, if the bandwidth of the external memory is assumed to be 16 bits, to calculate the pixel values at ½, ¼ and ⅛ points, the integer point data of the whole frame has to be captured in each category, i.e., to capture 396×256×1.5/16=76032 times.
In view of the above, in video encoding and decoding systems, it is desirable to reduce the amount of operation for calculating the interpolation points and the memory space required for storing the interpolation points. It is also desirable to reduce the frequency of reading integer points data from the external memory.